GTK+ works by explicitly specifying a -symbolic suffix for all icons.
Do the same here.
https://bugzilla.gnome.org/show_bug.cgi?id=682540
Extends: MessageTray.Source,
_init: function() {
- this.parent(_("Removable Devices"), 'media-removable', St.IconType.FULLCOLOR);
+ this.parent(_("Removable Devices"), 'media-removable');
this.showInLockScreen = false;
this._mounts = [];
let icon = item.iconActor;
if (!icon) {
icon = new St.Icon({ icon_name: item.iconName,
- icon_type: St.IconType.SYMBOLIC,
icon_size: POPUP_APPICON_SIZE });
}
box.add(icon, { x_fill: false, y_fill: false } );
_createIcon: function(size) {
this._iconActor = new St.Icon({ icon_name: 'view-grid-symbolic',
+ icon_size: size,
style_class: 'show-apps-icon',
- track_hover: true,
- icon_type: St.IconType.SYMBOLIC,
- icon_size: size });
+ track_hover: true });
return this._iconActor;
},
label: C_("button", "Restart") },
{ signal: 'ConfirmedShutdown',
label: C_("button", "Power Off") }],
- iconName: 'system-shutdown',
+ iconName: 'system-shutdown-symbolic',
iconStyleClass: 'end-session-dialog-shutdown-icon'
};
endDescription: _("Restarting the system."),
confirmButtons: [{ signal: 'ConfirmedReboot',
label: C_("button", "Restart") }],
- iconName: 'system-shutdown',
+ iconName: 'system-shutdown-symbolic',
iconStyleClass: 'end-session-dialog-shutdown-icon'
};
let textureCache = St.TextureCache.get_default();
let icon = textureCache.load_icon_name(this._iconBin.get_theme_node(),
iconName,
- St.IconType.SYMBOLIC,
_DIALOG_ICON_SIZE);
this._iconBin.child = icon;
_init: function(keyboard) {
this._keyboard = keyboard;
- this.parent(_("Keyboard"), 'input-keyboard', St.IconType.SYMBOLIC);
+ this.parent(_("Keyboard"), 'input-keyboard-symbolic');
},
handleSummaryClick: function() {
let toolbar = new St.BoxLayout({ name: 'Toolbar' });
this.actor.add_actor(toolbar);
let inspectIcon = new St.Icon({ icon_name: 'gtk-color-picker',
- icon_type: St.IconType.FULLCOLOR,
icon_size: 24 });
toolbar.add_actor(inspectIcon);
inspectIcon.reactive = true;
SOURCE_ICON_SIZE: 48,
- _init: function(title, iconName, iconType) {
+ _init: function(title, iconName) {
this.title = title;
this.iconName = iconName;
- this.iconType = iconType;
this.isTransient = false;
this.isChat = false;
// something more fancy.
createIcon: function(size) {
return new St.Icon({ icon_name: this.iconName,
- icon_type: this.iconType,
icon_size: size });
},
Extends: Source,
_init: function() {
- this.parent(_("System Information"), 'dialog-information', St.IconType.SYMBOLIC);
+ this.parent(_("System Information"), 'dialog-information-symbolic');
this.setTransient(true);
},
let gicon = this._iconForNotificationData(icon, hints);
let iconActor = new St.Icon({ gicon: gicon,
- icon_type: St.IconType.FULLCOLOR,
icon_size: MessageTray.NOTIFICATION_ICON_SIZE });
if (notification == null) {
// Translators: this is the name of the dock/favorites area on
// the left of the overview
- Main.ctrlAltTabManager.addGroup(this._dash.actor, _("Dash"), 'user-bookmarks');
+ Main.ctrlAltTabManager.addGroup(this._dash.actor, _("Dash"), 'user-bookmarks-symbolic');
Main.layoutManager.connect('monitors-changed', Lang.bind(this, this._relayout));
this._relayout();
this._menus.addMenu(this._dateMenu.menu);
Main.layoutManager.panelBox.add(this.actor);
- Main.ctrlAltTabManager.addGroup(this.actor, _("Top Bar"), 'start-here',
+ Main.ctrlAltTabManager.addGroup(this.actor, _("Top Bar"), 'start-here-symbolic',
{ sortGroup: CtrlAltTab.SortGroup.TOP });
},
addIcon: function(gicon) {
let icon = new St.Icon({ gicon: gicon,
- icon_type: St.IconType.SYMBOLIC,
style_class: 'system-status-icon' });
this._box.add_actor(icon);
createIcon: function(size, meta) {
if (meta['gicon']) {
return new St.Icon({ gicon: Gio.icon_new_for_string(meta['gicon']),
- icon_size: size,
- icon_type: St.IconType.FULLCOLOR });
+ icon_size: size });
} else if (meta['icon-data']) {
let [width, height, rowStride, hasAlpha,
bitsPerSample, nChannels, data] = meta['icon-data'];
// Ugh, but we want to fall back to something ...
return new St.Icon({ icon_name: 'text-x-generic',
- icon_size: size,
- icon_type: St.IconType.FULLCOLOR });
+ icon_size: size });
},
_getResultsFinished: function(results, error) {
Extends: MessageTray.Source,
_init: function() {
- this.parent('', 'media-removable', St.IconType.FULLCOLOR);
+ this.parent('', 'media-removable');
this._notification = null;
Main.messageTray.add(this);
Extends: PanelMenu.SystemStatusButton,
_init: function() {
- this.parent('preferences-desktop-accessibility', _("Accessibility"));
+ this.parent('preferences-desktop-accessibility-symbolic', _("Accessibility"));
let highContrast = this._buildHCItem();
this.menu.addMenuItem(highContrast);
Extends: PanelMenu.SystemStatusButton,
_init: function() {
- this.parent('bluetooth-disabled', _("Bluetooth"));
+ this.parent('bluetooth-disabled-symbolic', _("Bluetooth"));
this._applet = new GnomeBluetoothApplet.Applet();
if (on) {
this._discoverable.actor.show();
- this.setIcon('bluetooth-active');
+ this.setIcon('bluetooth-active-symbolic');
} else {
this._discoverable.actor.hide();
- this.setIcon('bluetooth-disabled');
+ this.setIcon('bluetooth-disabled-symbolic');
}
},
_ensureSource: function() {
if (!this._source) {
- this._source = new MessageTray.Source(_("Bluetooth"), 'bluetooth-active', St.IconType.SYMBOLIC);
+ this._source = new MessageTray.Source(_("Bluetooth"), 'bluetooth-active-symbolic');
Main.messageTray.add(this._source);
}
},
this._secureIcon = new St.Icon({ style_class: 'popup-menu-icon' });
if (this.bestAP._secType != NMAccessPointSecurity.UNKNOWN &&
this.bestAP._secType != NMAccessPointSecurity.NONE)
- this._secureIcon.icon_name = 'network-wireless-encrypted';
+ this._secureIcon.icon_name = 'network-wireless-encrypted-symbolic';
this._icons.add_actor(this._secureIcon);
},
_getIcon: function() {
if (this.bestAP.mode == NM80211Mode.ADHOC)
- return 'network-workgroup';
+ return 'network-workgroup-symbolic';
else
- return 'network-wireless-signal-' + signalToIcon(this.bestAP.strength);
+ return 'network-wireless-signal-' + signalToIcon(this.bestAP.strength) + '-symbolic';
}
});
},
_getSignalIcon: function() {
- return 'network-cellular-signal-' + signalToIcon(this.mobileDevice.signal_quality);
+ return 'network-cellular-signal-' + signalToIcon(this.mobileDevice.signal_quality) + '-symbolic';
},
_createSection: function() {
{ reactive: false });
else
this._activeConnectionItem = new PopupMenu.PopupImageMenuItem(title,
- 'network-wireless-connected',
+ 'network-wireless-connected-symbolic',
{ reactive: false });
this._activeConnectionItem.setShowDot(true);
},
_init: function() {
this.parent('network-offline', _('Network'));
- this.secondaryIcon = this.addIcon(new Gio.ThemedIcon({ name: 'network-vpn' }));
+ this.secondaryIcon = this.addIcon(new Gio.ThemedIcon({ name: 'network-vpn-symbolic' }));
this.secondaryIcon.hide();
this._isLocked = false;
_ensureSource: function() {
if (!this._source) {
this._source = new MessageTray.Source(_("Network Manager"),
- 'network-transmit-receive',
- St.IconType.SYMBOLIC);
+ 'network-transmit-receive-symbolic');
this._source.connect('destroy', Lang.bind(this, function() {
this._source = null;
this._ensureSource();
let icon = new St.Icon({ icon_name: iconName,
- icon_type: St.IconType.SYMBOLIC,
icon_size: MessageTray.NOTIFICATION_ICON_SIZE });
device._notification = new MessageTray.Notification(this._source, title, text,
{ icon: icon });
let wrapperClass = this._dtypes[device.get_device_type()];
if (wrapperClass) {
let wrapper = this._makeWrapperDevice(wrapperClass, device);
-
let section = this._devices[wrapper.category].section;
let devices = this._devices[wrapper.category].devices;
this.actor.visible = this.mainIcon.visible && !this._isLocked;
if (!this._client.networking_enabled) {
- this.setIcon('network-offline');
+ this.setIcon('network-offline-symbolic');
this._hideDevices();
this._statusItem.label.text = _("Networking is disabled");
this._statusSection.actor.show();
let hasMobileIcon = false;
if (!mc) {
- this.setIcon('network-offline');
+ this.setIcon('network-offline-symbolic');
} else if (mc.state == NetworkManager.ActiveConnectionState.ACTIVATING) {
switch (mc._section) {
case NMConnectionCategory.WWAN:
- this.setIcon('network-cellular-acquiring');
+ this.setIcon('network-cellular-acquiring-symbolic');
break;
case NMConnectionCategory.WIRELESS:
- this.setIcon('network-wireless-acquiring');
+ this.setIcon('network-wireless-acquiring-symbolic');
break;
case NMConnectionCategory.WIRED:
- this.setIcon('network-wired-acquiring');
+ this.setIcon('network-wired-acquiring-symbolic');
break;
default:
// fallback to a generic connected icon
// (it could be a private connection of some other user)
- this.setIcon('network-wired-acquiring');
+ this.setIcon('network-wired-acquiring-symbolic');
}
} else {
let dev;
log('An active wireless connection, in infrastructure mode, involves no access point?');
break;
}
- this.setIcon('network-wireless-connected');
+ this.setIcon('network-wireless-connected-symbolic');
} else {
if (this._activeAccessPoint != ap) {
if (this._accessPointUpdateId)
this._activeAccessPoint.disconnect(this._accessPointUpdateId);
this._activeAccessPoint = ap;
this._activeAccessPointUpdateId = ap.connect('notify::strength', Lang.bind(this, function() {
- this.setIcon('network-wireless-signal-' + signalToIcon(ap.strength));
+ this.setIcon('network-wireless-signal-' + signalToIcon(ap.strength) + '-symbolic');
}));
}
- this.setIcon('network-wireless-signal-' + signalToIcon(ap.strength));
+ this.setIcon('network-wireless-signal-' + signalToIcon(ap.strength) + '-symbolic');
hasApIcon = true;
}
break;
break;
}
case NMConnectionCategory.WIRED:
- this.setIcon('network-wired');
+ this.setIcon('network-wired-symbolic');
break;
case NMConnectionCategory.WWAN:
dev = mc._primaryDevice;
}
if (!dev.mobileDevice) {
// this can happen for bluetooth in PAN mode
- this.setIcon('network-cellular-connected');
+ this.setIcon('network-cellular-connected-symbolic');
break;
}
this._mobileUpdateDevice.disconnect(this._mobileUpdateId);
this._mobileUpdateDevice = dev.mobileDevice;
this._mobileUpdateId = dev.mobileDevice.connect('notify::signal-quality', Lang.bind(this, function() {
- this.setIcon('network-cellular-signal-' + signalToIcon(dev.mobileDevice.signal_quality));
+ this.setIcon('network-cellular-signal-' + signalToIcon(dev.mobileDevice.signal_quality) + '-symbolic');
}));
}
- this.setIcon('network-cellular-signal-' + signalToIcon(dev.mobileDevice.signal_quality));
+ this.setIcon('network-cellular-signal-' + signalToIcon(dev.mobileDevice.signal_quality) + '-symbolic');
hasMobileIcon = true;
break;
default:
// fallback to a generic connected icon
// (it could be a private connection of some other user)
- this.setIcon('network-wired');
+ this.setIcon('network-wired-symbolic');
break;
}
}
Extends: PanelMenu.SystemStatusButton,
_init: function() {
- this.parent('battery-missing', _("Battery"));
+ this.parent('battery-missing-symbolic', _("Battery"));
this._proxy = new PowerManagerProxy(Gio.DBus.session, BUS_NAME, OBJECT_PATH);
this._label = new St.Label({ text: this._deviceTypeToString(device_type) });
this._icon = new St.Icon({ gicon: Gio.icon_new_for_string(icon),
- icon_type: St.IconType.SYMBOLIC,
style_class: 'popup-menu-icon' });
this._box.add_actor(this._icon);
_volumeToIcon: function(volume) {
if (volume <= 0) {
- return 'audio-volume-muted';
+ return 'audio-volume-muted-symbolic';
} else {
let n = Math.floor(3 * volume / this._volumeMax) + 1;
if (n < 2)
- return 'audio-volume-low';
+ return 'audio-volume-low-symbolic';
if (n >= 3)
- return 'audio-volume-high';
- return 'audio-volume-medium';
+ return 'audio-volume-high-symbolic';
+ return 'audio-volume-medium-symbolic';
}
},
slider.setValue(muted ? 0 : (this[property].volume / this._volumeMax));
if (property == '_output') {
if (muted)
- this.emit('icon-changed', 'audio-volume-muted');
+ this.emit('icon-changed', 'audio-volume-muted-symbolic');
else
this.emit('icon-changed', this._volumeToIcon(this._output.volume));
}
_ensureSubscriptionSource: function() {
if (this._subscriptionSource == null) {
this._subscriptionSource = new MessageTray.Source(_("Subscription request"),
- 'gtk-dialog-question',
- St.IconType.FULLCOLOR);
+ 'gtk-dialog-question');
Main.messageTray.add(this._subscriptionSource);
this._subscriptionSource.connect('destroy', Lang.bind(this, function () {
this._subscriptionSource = null;
_ensureAccountSource: function() {
if (this._accountSource == null) {
this._accountSource = new MessageTray.Source(_("Connection error"),
- 'gtk-dialog-error',
- St.IconType.FULLCOLOR);
+ 'gtk-dialog-error');
Main.messageTray.add(this._accountSource);
this._accountSource.connect('destroy', Lang.bind(this, function () {
this._accountSource = null;
this._iconBox.child = textureCache.load_uri_async(uri, this._iconBox._size, this._iconBox._size);
} else {
this._iconBox.child = new St.Icon({ icon_name: 'avatar-default',
- icon_type: St.IconType.FULLCOLOR,
icon_size: this._iconBox._size });
}
createSecondaryIcon: function() {
let iconBox = new St.Bin();
- iconBox.child = new St.Icon({ style_class: 'secondary-icon',
- icon_type: St.IconType.FULLCOLOR });
+ iconBox.child = new St.Icon({ style_class: 'secondary-icon' });
let presenceType = this._contact.get_presence_type();
switch (presenceType) {
}
else {
iconBox.child = new St.Icon({ icon_name: 'avatar-default',
- icon_type: St.IconType.FULLCOLOR,
icon_size: iconBox._size });
}
} else {
this.actor.style = null;
this.actor.child = new St.Icon({ icon_name: 'avatar-default',
- icon_type: St.IconType.SYMBOLIC,
icon_size: DIALOG_ICON_SIZE });
}
}
let item;
- item = new IMStatusItem(_("Available"), 'user-available');
+ item = new IMStatusItem(_("Available"), 'user-available-symbolic');
this._combo.addMenuItem(item, IMStatus.AVAILABLE);
- item = new IMStatusItem(_("Busy"), 'user-busy');
+ item = new IMStatusItem(_("Busy"), 'user-busy-symbolic');
this._combo.addMenuItem(item, IMStatus.BUSY);
- item = new IMStatusItem(_("Invisible"), 'user-invisible');
+ item = new IMStatusItem(_("Invisible"), 'user-invisible-symbolic');
this._combo.addMenuItem(item, IMStatus.HIDDEN);
- item = new IMStatusItem(_("Away"), 'user-away');
+ item = new IMStatusItem(_("Away"), 'user-away-symbolic');
this._combo.addMenuItem(item, IMStatus.AWAY);
- item = new IMStatusItem(_("Idle"), 'user-idle');
+ item = new IMStatusItem(_("Idle"), 'user-idle-symbolic');
this._combo.addMenuItem(item, IMStatus.IDLE);
- item = new IMStatusItem(_("Unavailable"), 'user-offline');
+ item = new IMStatusItem(_("Unavailable"), 'user-offline-symbolic');
this._combo.addMenuItem(item, IMStatus.OFFLINE);
this._combo.connect('active-item-changed',
box.add(this._iconBox, { y_align: St.Align.MIDDLE, y_fill: false });
let textureCache = St.TextureCache.get_default();
- this._offlineIcon = new St.Icon({ icon_name: 'user-offline',
+ this._offlineIcon = new St.Icon({ icon_name: 'user-offline-symbolic',
style_class: 'popup-menu-icon' });
- this._availableIcon = new St.Icon({ icon_name: 'user-available',
+ this._availableIcon = new St.Icon({ icon_name: 'user-available-symbolic',
style_class: 'popup-menu-icon' });
- this._busyIcon = new St.Icon({ icon_name: 'user-busy',
+ this._busyIcon = new St.Icon({ icon_name: 'user-busy-symbolic',
style_class: 'popup-menu-icon' });
- this._invisibleIcon = new St.Icon({ icon_name: 'user-invisible',
+ this._invisibleIcon = new St.Icon({ icon_name: 'user-invisible-symbolic',
style_class: 'popup-menu-icon' });
- this._awayIcon = new St.Icon({ icon_name: 'user-away',
+ this._awayIcon = new St.Icon({ icon_name: 'user-away-symbolic',
style_class: 'popup-menu-icon' });
- this._idleIcon = new St.Icon({ icon_name: 'user-idle',
+ this._idleIcon = new St.Icon({ icon_name: 'user-idle-symbolic',
style_class: 'popup-menu-icon' });
this._pendingIcon = new St.Icon({ icon_name: 'user-status-pending',
style_class: 'popup-menu-icon' });
global.stage.connect('notify::key-focus', Lang.bind(this, this._onStageKeyFocusChanged));
this._inactiveIcon = new St.Icon({ style_class: 'search-entry-icon',
- icon_name: 'edit-find',
- icon_type: St.IconType.SYMBOLIC });
+ icon_name: 'edit-find-symbolic' });
this._activeIcon = new St.Icon({ style_class: 'search-entry-icon',
- icon_name: 'edit-clear',
- icon_type: St.IconType.SYMBOLIC });
+ icon_name: 'edit-clear-symbolic' });
this._entry.set_secondary_icon(this._inactiveIcon);
this._iconClickedId = 0;
this._workspacesDisplay = new WorkspacesView.WorkspacesDisplay();
this._workspacesPage = this._addPage(this._workspacesDisplay.actor, null,
- _("Windows"), 'text-x-generic');
+ _("Windows"), 'text-x-generic-symbolic');
this._appDisplay = new AppDisplay.AllAppDisplay();
this._appsPage = this._addPage(this._appDisplay.actor, null,
- _("Applications"), 'system-run');
+ _("Applications"), 'system-run-symbolic');
this._searchResults = new SearchDisplay.SearchResults(this._searchSystem);
this._searchPage = this._addPage(this._searchResults.actor, this._entry,
- _("Search"), 'edit-find');
+ _("Search"), 'edit-find-symbolic');
// Default search providers
// Wanda comes obviously first
if (!this._imageFile) {
return new St.Icon({ icon_name: 'face-smile',
- icon_type: St.IconType.FULLCOLOR,
- icon_size: iconSize
- });
+ icon_size: iconSize });
}
this._animations = St.TextureCache.get_default().load_sliced_image(this._imageFile, this._imgWidth, this._imgHeight);
// triggers an assertion failure)
return St.TextureCache.get_default().load_icon_name(null,
'face-smile',
- St.IconType.FULLCOLOR,
iconSize);
}
}]);
x_fill: true,
y_fill: false,
track_hover: true });
- let icon = new St.Icon({ icon_name: 'system-run',
- icon_type: St.IconType.SYMBOLIC,
+ let icon = new St.Icon({ icon_name: 'system-run-symbolic',
style_class: 'system-status-icon' });
button.set_child(icon);
{
ClutterActor *icon = g_object_new (ST_TYPE_ICON,
"style-class", "capslock-warning",
- "icon-type", ST_ICON_SYMBOLIC,
- "icon-name", "dialog-warning",
+ "icon-name", "dialog-warning-symbolic",
NULL);
st_entry_set_secondary_icon (entry, icon);
PROP_GICON,
PROP_ICON_NAME,
- PROP_ICON_TYPE,
PROP_ICON_SIZE
};
guint opacity_handler_id;
GIcon *gicon;
- StIconType icon_type;
gint prop_icon_size; /* icon size set as property */
gint theme_icon_size; /* icon size from theme node */
gint icon_size; /* icon size we are using */
static gboolean st_icon_update_icon_size (StIcon *icon);
#define DEFAULT_ICON_SIZE 48
-#define DEFAULT_ICON_TYPE ST_ICON_SYMBOLIC
static void
st_icon_set_property (GObject *gobject,
st_icon_set_icon_name (icon, g_value_get_string (value));
break;
- case PROP_ICON_TYPE:
- st_icon_set_icon_type (icon, g_value_get_enum (value));
- break;
-
case PROP_ICON_SIZE:
st_icon_set_icon_size (icon, g_value_get_int (value));
break;
g_value_set_string (value, st_icon_get_icon_name (icon));
break;
- case PROP_ICON_TYPE:
- g_value_set_enum (value, st_icon_get_icon_type (icon));
- break;
-
case PROP_ICON_SIZE:
g_value_set_int (value, st_icon_get_icon_size (icon));
break;
NULL, ST_PARAM_READWRITE | G_PARAM_DEPRECATED);
g_object_class_install_property (object_class, PROP_ICON_NAME, pspec);
- pspec = g_param_spec_enum ("icon-type",
- "Icon type",
- "The type of icon that should be used",
- ST_TYPE_ICON_TYPE,
- DEFAULT_ICON_TYPE,
- ST_PARAM_READWRITE | G_PARAM_DEPRECATED);
- g_object_class_install_property (object_class, PROP_ICON_TYPE, pspec);
-
pspec = g_param_spec_int ("icon-size",
"Icon size",
"The size if the icon, if positive. Otherwise the size will be derived from the current style",
self->priv->icon_size = DEFAULT_ICON_SIZE;
self->priv->prop_icon_size = -1;
- self->priv->icon_type = DEFAULT_ICON_TYPE;
self->priv->shadow_material = COGL_INVALID_HANDLE;
self->priv->shadow_width = -1;
g_object_unref (priv->gicon);
if (icon_name)
- {
- if (priv->icon_type == ST_ICON_SYMBOLIC)
- priv->gicon = _st_make_symbolic_themed_icon (icon_name);
- else
- priv->gicon = g_themed_icon_new_with_default_fallbacks (icon_name);
- }
+ priv->gicon = g_themed_icon_new_with_default_fallbacks (icon_name);
else
priv->gicon = NULL;
st_icon_update (icon);
}
-/**
- * st_icon_get_icon_type:
- * @icon: a #StIcon
- *
- * Gets the type of icon we'll look up to display in the actor.
- * See st_icon_set_icon_type().
- *
- * Return value: the icon type.
- */
-StIconType
-st_icon_get_icon_type (StIcon *icon)
-{
- g_return_val_if_fail (ST_IS_ICON (icon), DEFAULT_ICON_TYPE);
-
- return icon->priv->icon_type;
-}
-
-/**
- * st_icon_set_icon_type:
- * @icon: a #StIcon
- * @icon_type: the type of icon to use
- *
- * Sets the type of icon we'll look up to display in the actor.
- * The icon type determines whether we use a symbolic icon or
- * a full color icon and also is used for specific handling for
- * application and document icons.
- */
-void
-st_icon_set_icon_type (StIcon *icon,
- StIconType icon_type)
-{
- StIconPrivate *priv;
-
- g_return_if_fail (ST_IS_ICON (icon));
-
- priv = icon->priv;
-
- if (icon_type == priv->icon_type)
- return;
-
- priv->icon_type = icon_type;
- st_icon_update (icon);
-
- g_object_notify (G_OBJECT (icon), "icon-type");
-}
-
/**
* st_icon_get_gicon:
* @icon: an icon
const gchar *st_icon_get_icon_name (StIcon *icon);
void st_icon_set_icon_name (StIcon *icon, const gchar *icon_name);
-void st_icon_set_icon_type (StIcon *icon, StIconType icon_type);
-StIconType st_icon_get_icon_type (StIcon *icon);
-
gint st_icon_get_icon_size (StIcon *icon);
void st_icon_set_icon_size (StIcon *icon, gint size);
shadow_box.x2, shadow_box.y2,
0, 0, 1, 1);
}
-
-/* generates names like g_themed_icon_new_with_default_fallbacks(),
- * but *only* symbolic names
- */
-static char **
-symbolic_names_for_icon (const char *name)
-{
- char **parts, **names;
- int i, numnames;
-
- parts = g_strsplit (name, "-", -1);
- numnames = g_strv_length (parts);
- names = g_new (char *, numnames + 1);
- for (i = 0; parts[i]; i++)
- {
- if (i == 0)
- {
- names[i] = g_strdup_printf ("%s-symbolic", parts[i]);
- }
- else
- {
- names[i] = g_strdup_printf ("%.*s-%s-symbolic",
- (int) (strlen (names[i - 1]) - strlen ("-symbolic")),
- names[i - 1], parts[i]);
- }
- }
- names[i] = NULL;
-
- g_strfreev (parts);
-
- /* need to reverse here, because longest (most specific)
- name has to come first */
- for (i = 0; i < (numnames / 2); i++) {
- char *tmp = names[i];
- names[i] = names[numnames - i - 1];
- names[numnames - i - 1] = tmp;
- }
- return names;
-}
-
-GIcon *
-_st_make_symbolic_themed_icon (const char *icon_name)
-{
- char **names;
- GIcon *themed;
-
- names = symbolic_names_for_icon (icon_name);
- themed = g_themed_icon_new_from_names (names, -1);
- g_strfreev (names);
-
- return themed;
-}
ClutterActorBox *box,
guint8 paint_opacity);
-GIcon *_st_make_symbolic_themed_icon (const char *icon_name);
-
#endif /* __ST_PRIVATE_H__ */
return actor;
}
-/**
- * StIconType:
- * @ST_ICON_SYMBOLIC: a symbolic (ie, mostly monochrome) icon
- * @ST_ICON_FULLCOLOR: a full-color icon
- *
- * Describes what style of icon is desired in a call to
- * st_texture_cache_load_icon_name() or st_texture_cache_load_gicon().
- * Use %ST_ICON_SYMBOLIC for symbolic icons (eg, for the panel and
- * much of the rest of the shell chrome) or %ST_ICON_FULLCOLOR for a
- * full-color icon.
- */
-
/**
* st_texture_cache_load_icon_name:
* @cache: The texture cache instance
* @theme_node: (allow-none): a #StThemeNode
* @name: Name of a themed icon
- * @icon_type: the type of icon to load
* @size: Size of themed icon
*
- * Load a themed icon into a texture. See the #StIconType documentation
- * for an explanation of how @icon_type affects the returned icon. The
- * colors used for symbolic icons are derived from @theme_node.
+ * Load a themed icon into a texture. The colors used for symbolic
+ * icons are derived from @theme_node.
*
* Return Value: (transfer none): A new #ClutterTexture for the icon
*/
st_texture_cache_load_icon_name (StTextureCache *cache,
StThemeNode *theme_node,
const char *name,
- StIconType icon_type,
gint size)
{
ClutterActor *texture;
GIcon *themed;
- g_return_val_if_fail (!(icon_type == ST_ICON_SYMBOLIC && theme_node == NULL), NULL);
+ themed = g_themed_icon_new_with_default_fallbacks (name);
+ texture = load_gicon_with_colors (cache, themed, size,
+ theme_node ? st_theme_node_get_icon_colors (theme_node) : NULL);
+ g_object_unref (themed);
- switch (icon_type)
+ if (texture == NULL)
{
- case ST_ICON_SYMBOLIC:
- themed = _st_make_symbolic_themed_icon (name);
- texture = load_gicon_with_colors (cache, themed, size,
- st_theme_node_get_icon_colors (theme_node));
- g_object_unref (themed);
- if (texture == NULL)
- {
- /* We don't have an equivalent of image-missing
- * for the symbolic icon theme, so just create a blank
- * actor. */
- texture = (ClutterActor *) create_default_texture ();
- clutter_actor_set_size (texture, size, size);
- }
-
- return texture;
- break;
- case ST_ICON_FULLCOLOR:
- themed = g_themed_icon_new_with_default_fallbacks (name);
- texture = load_gicon_with_colors (cache, themed, size, NULL);
- g_object_unref (themed);
- if (texture == NULL)
- {
- themed = g_themed_icon_new ("image-missing");
- texture = load_gicon_with_colors (cache, themed, size, NULL);
- g_object_unref (themed);
- }
- return texture;
- break;
- default:
- g_assert_not_reached ();
+ texture = (ClutterActor *) create_default_texture ();
+ clutter_actor_set_size (texture, size, size);
}
+
+ return texture;
}
/**
ClutterActor *st_texture_cache_load_icon_name (StTextureCache *cache,
StThemeNode *theme_node,
const char *name,
- StIconType icon_type,
gint size);
ClutterActor *st_texture_cache_load_gicon (StTextureCache *cache,
ST_ALIGN_END
} StAlign;
-typedef enum {
- ST_ICON_SYMBOLIC,
- ST_ICON_FULLCOLOR
-} StIconType;
-
typedef enum {
ST_BACKGROUND_SIZE_AUTO,
ST_BACKGROUND_SIZE_CONTAIN,
}
addTest("Symbolic",
- { icon_name: 'battery-full',
- icon_type: St.IconType.SYMBOLIC,
+ { icon_name: 'battery-full-symbolic',
icon_size: 48 });
addTest("Full color",
{ icon_name: 'battery-full',
- icon_type: St.IconType.FULLCOLOR,
icon_size: 48 });
addTest("Default size",
- { icon_name: 'battery-full',
- icon_type: St.IconType.SYMBOLIC });
+ { icon_name: 'battery-full-symbolic' });
addTest("Size set by property",
- { icon_name: 'battery-full',
- icon_type: St.IconType.SYMBOLIC,
+ { icon_name: 'battery-full-symbolic',
icon_size: 32 });
addTest("Size set by style",
- { icon_name: 'battery-full',
- icon_type: St.IconType.SYMBOLIC,
+ { icon_name: 'battery-full-symbolic',
style: 'icon-size: 1em;' });
addTest("16px icon in 48px icon widget",
- { icon_name: 'battery-full',
- icon_type: St.IconType.SYMBOLIC,
+ { icon_name: 'battery-full-symbolic',
style: 'icon-size: 16px; width: 48px; height: 48px; border: 1px solid black;' });
function iconRow(icons, box_style) {
for each (let iconName in icons) {
hb.add(new St.Icon({ icon_name: iconName,
- icon_type: St.IconType.SYMBOLIC,
icon_size: 48 }));
}
let normalCss = 'background: white; color: black; padding: 10px 10px;';
let reversedCss = 'background: black; color: white; warning-color: #ffcc00; error-color: #ff0000; padding: 10px 10px;';
- let batteryIcons = ['battery-full-charging',
- 'battery-full',
- 'battery-good',
- 'battery-low',
- 'battery-caution' ];
+ let batteryIcons = ['battery-full-charging-symbolic',
+ 'battery-full-symbolic',
+ 'battery-good-symbolic',
+ 'battery-low-symbolic',
+ 'battery-caution-symbolic' ];
- let volumeIcons = ['audio-volume-high',
- 'audio-volume-medium',
- 'audio-volume-low',
- 'audio-volume-muted' ];
+ let volumeIcons = ['audio-volume-high-symbolic',
+ 'audio-volume-medium-symbolic',
+ 'audio-volume-low-symbolic',
+ 'audio-volume-muted-symbolic' ];
iconRow(batteryIcons, normalCss);
iconRow(batteryIcons, reversedCss);